/**
 * @AccessHeader.java  COPYRIGHT xiaojian
 * 
 * Created on 2017年6月30日 下午2:27:37
 */
package xj.toolkit.access;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * @author <a href="mailto:cxj2000@gmail.com">xiaojian.cao</a>
 *
 */
public class AccessHeader {

	public static final int HEADER_LENGTH = 12;
	
	public static final String KEY = "ACCESS_HEADER";

	// index = 0 bytes = 2
	private short sourceModuleId;

	// index = 1 bytes = 2
	private short sourceInstanceId;

	// index = 2 bytes = 2
	private short targetModuleId = 0x0;

	// index = 3 bytes = 2
	private short targetInstanceId = 0x0;

	// (index = 4, bytes = 4)
	private int reserved = 0;

	public short getSourceModuleId() {
		return sourceModuleId;
	}

	public void setSourceModuleId(short sourceModuleId) {
		this.sourceModuleId = sourceModuleId;
	}

	public short getSourceInstanceId() {
		return sourceInstanceId;
	}

	public void setSourceInstanceId(short sourceInstanceId) {
		this.sourceInstanceId = sourceInstanceId;
	}

	public short getTargetModuleId() {
		return targetModuleId;
	}

	public void setTargetModuleId(short targetModuleId) {
		this.targetModuleId = targetModuleId;
	}

	public short getTargetInstanceId() {
		return targetInstanceId;
	}

	public void setTargetInstanceId(short targetInstanceId) {
		this.targetInstanceId = targetInstanceId;
	}

	public int getReserved() {
		return reserved;
	}

	public void setReserved(int reserved) {
		this.reserved = reserved;
	}

	public String toString() {
		return ToStringBuilder.reflectionToString(this);
	}
}
